package org.andao.commons.service;

import java.util.List;
import java.util.Map;

import org.andao.commons.model.AccessLogs;
import org.andao.core.base.service.BaseService;
import org.andao.core.dao.helper.Page;
import org.andao.core.exception.ServiceException;



/**
 * 系统访问日志管理服务接口.
 * 
 * @author Marco.hu(hzg139@163.com) 
 */
public interface AccessLogsService extends BaseService<AccessLogs> {

	/**
	 * 解析并保存日志
	 * @throws ServiceException
	 */
	void parseAndSaveAccessLogs(String fileName) throws Exception;
	/**
	 * 分页查询访问日志
	 * @param condition
	 * @param objPage
	 * @return
	 * @throws ServiceException
	 */
	Page findAccessLogsByCondition(Map<String, Object> condition,Page objPage) throws ServiceException;
	/**
	 * 日志文件
	 * @param date
	 * @return
	 * @throws ServiceException
	 */
	List<String> accessLogsDate() throws ServiceException;
	
	 /** 访问情况统计
	 * @param condition
	 * @return
	 * @throws ServiceException
	 */
	List<Map<String, Object>> statAccessLogsStatus(Map<String, Object> condition) throws ServiceException;
	/**
	 * 访问结果分析
	 * @param type serverstatus、clientbrowser、clientos
	 * @return
	 * @throws ServiceException
	 */
	List<Map<String, Object>> statAccessLogsResults(String type) throws ServiceException;
	/**
	 * 日志总记录数
	 * @return
	 * @throws ServiceException
	 */
	Double statAccessLogsResultsTotal() throws ServiceException;
	/**
	 * 访问排行
	 * @param type 1-并发访问次数、2-并发访问用户数、3-访问最多的资源、4-处理最慢的资源、5-错误做多的资源
	 * @return
	 * @throws ServiceException
	 */
	List<Map<String, Object>> statAccessLogsTop(int type) throws ServiceException;
}
